from typing import List

from loguru import logger
from fastapi import APIRouter
from starlette.responses import JSONResponse

from common.schema.taobao import *

from tasks.taobao import interface

tags = 'sms'
sms_router = APIRouter(
    prefix="/{}".format(tags),
    tags=[tags],
    # dependencies=[Depends(get_admin_token)],
    responses={404: {"description": "Not found"}},
    # on_startup=[get_adam_obj]
)

from fastapi import FastAPI, Request
# https://gitee.com/pp/SmsForwarder/wikis/pages?sort_id=5163453&doc_id=1821427
@sms_router.post("/text_message", summary="监听短信")
async def listen_message(request: Request):
    res = await request.body()
    body = str(res, 'utf-8')
    print(body)

@sms_router.post("/app", summary="监听app")
async def listen_message(request: Request):
    res = await request.body()
    body = str(res, 'utf-8')
    print(body)